#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "aux.h"

int
fileExists(char * filename)
{
	FILE * aux;
	if ((aux = fopen(filename, "r")) == NULL)
		return 0;
	
	fclose(aux);
	return 1;
}

void
printTicketParameters(ticketP * tickp)
{
	tickp->id[TICKET_LEN-1] = '\0';
	//tickp->filename[MAX_FILEL-1] = '\0';
	printf("Ticket ID: %s\n", tickp->id);
	//printf("Ticket filename: %s\n", tickp->filename);
	printf("Ticket enabled in: %d seconds\n", tickp->etime - tickp->dtime);
	printf("Ticket expires in: %d seconds\n", tickp->ftime - tickp->dtime);
}
